<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>职位列表</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <h1>职位列表</h1>
    <form method="get">
        <label for="job_name">职位名称:</label>
        <input type="text" name="job_name" id="job_name" placeholder="输入职位名称">
        <label for="category">类别:</label>
        <input type="text" name="category" id="category" placeholder="输入职位类别">
        <button type="submit">查询</button>
    </form>

    <div class="job-list">
        {% if jobs %}
            <ul>
                {% for job in jobs %}
                    <li>
                        <a href="/job/{{ job[0] }}">{{ job[1] }}</a> - {{ job[5] }}
                    </li>
                {% endfor %}
            </ul>
            {% if page > 1 %}
                <a href="?job_name={{ job_name }}&category={{ category }}&page={{ page - 1 }}">上一页</a>
            {% endif %}
            {% if page < total_pages %}
                <a href="?job_name={{ job_name }}&category={{ category }}&page={{ page + 1 }}">下一页</a>
            {% endif %}
        {% else %}
            <p>没有找到相关职位。</p>
        {% endif %}
    </div>
</body>
</html>